package me.keiwu.admin.util.bean;

import lombok.Getter;

/**
 * Created by kei on 01/11/2017.
 */
public enum RoleConst {

    ROLE_SUPER_ADMIN(1, "ROLE_ADMIN"),
    ROLE_ADMIN(2, "ROLE_ADMIN"),
    ;

    @Getter
    private int type;
    @Getter
    private String value;

    RoleConst(int type, String value) {
        this.type = type;
        this.value = value;
    }


    public static RoleConst parse(int type) {
        for (RoleConst roleConst : RoleConst.values()) {
            if (roleConst.getType() == type) {
                return roleConst;
            }
        }
        return null;
    }

}
